﻿<%@ Page Language="C#" MasterPageFile="~/Web/FarmMaster.master" AutoEventWireup="true" CodeFile="ViewAnswer.aspx.cs" Inherits="Web_ViewAnswer" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <link href="../App_Themes/WebBlue/Question.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div id="main">
		<div class="left">
			<div class="left1">
				<div id="PARENT">
					<ul	id="navv">
						<li class="first"><a>在线答疑</a>
						</li>
                        <li><a href="Question.aspx">在线答疑</a></li> 
                        <li><a href="ListQuestions.aspx">已有问题</a></li>
					</ul>
				</div>
			</div>
			<div class="left2" style="padding-top:13px;">
				<div class="tle">
					<span class="text1">培训通知</span>
				</div>
				<div class="tents">
					<ul style=" padding-top:5px;">
                       <%
                        if (ts.Count() != 0)
                        {
                            foreach (Train aT in ts)
                            {
                                string memo = aT.Name + "将于" + string.Format("{0:yyyy-MM-dd HH:mm}", aT.Started) + "在" + aT.Address + "举办";
                    
                                if (aT.Amended != null)
                                {
                    %>
                                <li>[<span style="color:#f60">变更公示</span>]<a href='ViewTrain.aspx?pid=<%=aT.ID %>'><%=memo.Length > 7 ? memo.Substring(0, 6) + "..." : memo%></a></li>
                     <%                                                    
                                }
                                else
                                { 
                     %>    <li><a href='ViewTrain.aspx?pid=<%=aT.ID %>'><%=memo.Length > 12 ? memo.Substring(0, 11) + "..." : memo%></a></li>
                                                
                    <%                       } 
                            }
                        }     
                    %>
						
					</ul>
				</div>
			</div>
			<div class="left2">
				<div class="tle">
					<span class="text1">最新动态</span>
				</div>
				<div class="tents">
					<ul style=" padding-top:5px;">
						<asp:Repeater ID="Repeater3" runat="server">
                            <ItemTemplate>
                                <li><a href='<%=Toolkit.ApplicationRoot %>/Html/<%#Eval("url") %>'><%#Eval("Title").ToString().Length>12?Eval("Title").ToString().Substring(0,11)+"...":Eval("Title") %></a></li>
                            </ItemTemplate>
                        </asp:Repeater>
					</ul>
				</div>
			</div>
		</div>
		<div class="right">
			<div id="content">
                <div class="Kind"><%=question.Kind %> - <%=question.Subject %> - <%=question.Course %></div>
                    <div class="Question">
                        <div class="Title"><%=question.Title %></div>
                        <div class="Vector">
                            <span class="Name"><%=question.Name %></span>
                            <span class="Time">
                                <%
                                    DateTime now = DateTime.Now;
                                    DateTime old = question.Time;

                                    if (string.Format("{0:yyyy-MM-dd}", now) == string.Format("{0:yyyy-MM-dd}", old))
                                    {
                                %>
                    
                                今天 <%=string.Format("{0:HH:mm}", old)%>

                                <%
                                    }
                                    else
                                    {
                                %>

                                <%=string.Format("{0:yyyy-MM-dd HH:mm}", old) %>

                                <%
                                    }                        
                                %>
                            </span>
                        </div>
                        <div style="clear: both"></div>
                        <div class="Memo">
                            <%=question.Memo %>
                        </div>
                    </div>

                    <div class="Answers">
                        <div class="Title">问题答案</div>
                        <asp:ListView ID="RecordView" runat="server">
                            <LayoutTemplate>
                                <div id="itemPlaceholder" runat="server"></div>
                            </LayoutTemplate>
                            <ItemTemplate>
                                <div id="Div1" class="Answer" runat="server"> 
                                    <div class="Header">
                                        <span class="Name"><%#Eval("Name") %></span>
                                        <span class="Time"><%#Eval("Time") %></span>
                                    </div>
                                    <div class="Memo">
                                        <%#Eval("Memo") %>
                                    </div>
                                    <div style="clear: both"></div>
                                </div>
                            </ItemTemplate>
                            <ItemSeparatorTemplate>
                                <div class="Separator"></div>
                            </ItemSeparatorTemplate>
                        </asp:ListView>
                    </div>
			</div>
		</div>
	</div>
</asp:Content>
